import http from '@/http.js';
//登录
export const loginIn = async(data,loading = true) => http.request({
    url:"/login/userLogin",
    method:"post",
    data,
    loading,
})
export const wxlogin = async(data,loading = true) => http.request({
    url:"/login/getWechatToken",
    method:"post",
    data,
    loading,
})
//获取用户信息
export const getUserInfo = async(data,loading = true) => http.request({
    url:"/user/getUserInfo",
    method:"POST",
    data,
    loading,
})
//修改支付密码
export const editPassword = async(data,loading = true) => http.request({
    url:"/user/saveUserPayPasswd",
    method:"POST",
    data,
    loading,
})
//支付订单
export const payOrder = async(data,loading = true) => http.request({
    url:"/user/balancePayment",
    method:"POST",
    data,
    loading,
})
//提交反馈
export const submitFeedback = async(data,loading = true) => http.request({
    url:"/user/saveUserFeedback",
    method:"POST",
    data,
    loading,
})
//关于我们
export const getAboutUs = async(data,loading = true) => http.request({
    url:"/home/getAboutUs",
    method:"POST",
    data,
    loading,
})
//获取操作指南
export const getOpation = async(data,loading = true) => http.request({
    url:"/home/getOperationGuide",
    method:"POST",
    data,
    loading,
})
//获取首页数据
export const getTabMainData = async(data,loading = true) => http.request({
    url:"/home/getHomeData",
    method:"POST",
    data,
    loading,
})
//获取物品类型
export const getGoodsType = async(data,loading = true) => http.request({
    url:"/home/getFeeCategoryAll",
    method:"POST",
    data:{type:1},
    loading,
})
//快递估价
export const ficPrice = async(data,loading = true) => http.request({
    url:"/user/getExpressFreight",
    method:"POST",
    data,
    loading,
})
//时效估价接口
export const ficNewPrice = async(data,loading = true) => http.request({
    url:"/user/getFreightPrice",
    method:"POST",
    data,
    loading,
})
//获取快递费率
export const getUnit = async(data,loading = true) => http.request({
    url:"/user/getInsuredUnit",
    method:"POST",
    data,
    loading,
})
//获取快递公司列表
export const getCouComList = async(data,loading = true) => http.request({
    url:"/user/getExpressList",
    method:"POST",
    data,
    loading,
})
//余额明细
export const getMoneyMx = async(data,loading = true) => http.request({
    url:"/user/getExpressLog",
    method:"POST",
    data,
    loading,
})
//获取收货地址列表
export const addressList = async(data,loading = true) => http.request({
    url:"/user/getReceivbList",
    method:"POST",
    data,
    loading,
})
//获取某一个收货地址信息
export const addressOne = async(data,loading = true) => http.request({
    url:"/user/getReceivbRow",
    method:"POST",
    data,
    loading,
})
//添加收货地址
export const addressAdd = async(data,loading = true) => http.request({
    url:"/user/addReceivb",
    method:"POST",
    data,
    loading,
})
//编辑收货地址
export const addressEdit = async(data,loading = true) => http.request({
    url:"/user/editReceivb",
    method:"POST",
    data,
    loading,
})
//删除收货地址
export const addressDelete = async(data,loading = true) => http.request({
    url:"/user/delReceivb",
    method:"POST",
    data,
    loading,
})
//添加包裹
export const baoguoAdd = async(data,loading = true) => http.request({
    url:"/user/savePackage",
    method:"POST",
    data,
    loading,
})
//包裹列表
export const baoguoList = async(data,loading = true) => http.request({
    url:"/user/getPackageList",
    method:"POST",
    data,
    loading,
})
//包裹编辑
export const baoguoEdit = async(data,loading = true) => http.request({
    url:"/user/editPackage",
    method:"POST",
    data,
    loading,
})
//包裹删除
export const baoguoDelete = async(data,loading = true) => http.request({
    url:"/user/delPackage",
    method:"POST",
    data,
    loading,
})
//包裹信息
export const baoguoInfo = async(data,loading = true) => http.request({
    url:"/user/getPackageRow",
    method:"POST",
    data,
    loading,
})
//获取可用的包裹
export const getCanUserBaoguo = async(data,loading = true) => http.request({
    url:"/user/getSengPackageAll",
    method:"POST",
    data,
    loading,
})
//发货仓库
export const getSendCangku = async(data,loading = true) => http.request({
    url:"/user/getSendDepository",
    method:"POST",
    data,
    loading,
})
//快递估计运费
export const calcExpressPrice = async(data,loading = true) => http.request({
    url:"/user/getExpressFreight",
    method:"POST",
    data,
    loading,
})
//快递下单
export const createOrder = async(data,loading = true) => http.request({
    url:"/user/saveExpressOrder",
    method:"POST",
    data,
    loading,
})
//快递订单 列表
export const getOrderList = async(data,loading = true) => http.request({
    url:"/user/getOrderList",
    method:"POST",
    data,
    loading,
})
//获取订单详情
export const getOrderDtl = async(data,loading = true) => http.request({
    url:"/user/getOrderDetails",
    method:"POST",
    data,
    loading,
})
//取消订单
export const cancleOrder = async(data,loading = true) => http.request({
    url:"/user/saveCancelOrder",
    method:"POST",
    data,
    loading,
})
//编辑订单
export const editOrder = async(data,loading = true) => http.request({
    url:"/user/saveEditOrder",
    method:"POST",
    data,
    loading,
})
//确认订单 
export const confirmOrder = async(data,loading = true) => http.request({
    url:"/user/confirmTheOrder",
    method:"POST",
    data,
    loading,
})
//获取可以认领的包裹
export const getRenLing = async(data,loading = true) => http.request({
    url:"/user/getThePackageToBeClaimed",
    method:"POST",
    data,
    loading,
})
//提交认领
export const submitRenling = async(data,loading = true) => http.request({
    url:"/user/collectPackage",
    method:"POST",
    data,
    loading,
})
//微信支付配置
export const getWxConfig = async(data,loading = true) => http.request({
    url:"/login/getJssdkConfig",
    method:"POST",
    data,
    loading,
})
//订单微信支付
export const getWxCreatedOrder = async(data,loading = true) => http.request({
    url:"/user/wechatPay",
    method:"POST",
    data,
    loading,
})
//充值微信支付
export const getWxChong = async(data,loading = true) => http.request({
    url:"/user/saveUserRecharge",
    method:"POST",
    data,
    loading,
})
//获取充值列表
export const getChongList = async(data,loading = true) => http.request({
    url:"/user/getPayUp",
    method:"POST",
    data,
    loading,
})
//获取积分列表
export const getJifenList = async(data,loading = true) => http.request({
    url:"/user/getScoreLog",
    method:"POST",
    data,
    loading,
})
//积分转余额
export const jifenToMoney = async(data,loading = true) => http.request({
    url:"/user/pointsToBalance",
    method:"POST",
    data,
    loading,
})
//获取邮编地址
export const getAreaList = async(data,loading = true) => http.request({
    url:"/user/getAddCode",
    method:"POST",
    data,
    loading,
})
//查询邮编地址
export const searchAreaCode = async(data,loading = true) => http.request({
    url:"/user/getAddCodeSelect",
    method:"POST",
    data,
    loading,
})
//获取开箱检查费用
export const getBoxPrice = async(data,loading = true) => http.request({
    url:"/user/getSeePrice",
    method:"POST",
    data,
    loading,
})
//打木架说明
export const getMujiaInfo = async(data,loading = true) => http.request({
    url:"/user/woodIntroduce",
    method:"POST",
    data,
    loading,
})
//查询订单数量
export const getOrderNums = async(data,loading = true) => http.request({
    url:"/user/getOrderNum",
    method:"POST",
    data,
    loading,
})
//查询订单
export const getBaoguoNums = async(data,loading = true) => http.request({
    url:"/user/getPackageNum",
    method:"POST",
    data,
    loading,
})
//图片上传
export const upFile = (formData,loading = true) => {
    return new Promise((resolve,reject) => {
        http.request({
            url:"/home/imageUpload",
            method:"post",
            data:formData,
            headers: {
                'Content-Type': 'multipart/form-data'
            },
            loading,
        }).then( res => {
            if(res.code == 1){
                resolve(res.data)
            }else{ reject("code-0")}
        }).catch(err => {
            reject(err)
        })
    })
}